package com.tuniu.agents.memory;

import org.springframework.ai.chat.messages.Message;

import java.util.List;

/**
 * Chat context information operations
 */
public interface MemoryManager {

    /**
     * Get chat messages for a specific conversation.
     * @param conversationId The ID of the conversation.
     * @return A list of chat messages.
     */
    List<Message> getChatMessage(String conversationId);

    /**
     * Get agent messages for a specific conversation and agent.
     * @param conversationId The ID of the conversation.
     * @param agentId The ID of the agent.
     * @return A list of agent messages.
     */
    List<Message> getAgentMessage(String conversationId, String agentId);

    /**
     * Set all messages for a specific conversation.
     * @param conversationId The ID of the conversation.
     * @param messages The list of messages to set.
     * @return True if the operation was successful, false otherwise.
     */
    boolean setMessageAll(String conversationId, List<Message> messages);

    /**
     * Set the right messages for a specific conversation.
     * @param conversationId The ID of the conversation.
     * @param messages The list of messages to set.
     * @return True if the operation was successful, false otherwise.
     */
    boolean setMessageRight(String conversationId, List<Message> messages);

    /**
     * Remove all messages for a specific conversation.
     * @param conversationId The ID of the conversation.
     * @return True if the operation was successful, false otherwise.
     */
    boolean remove(String conversationId);

    /**
     * Remove all messages except the latest for a specific conversation and agent.
     * @param conversationId The ID of the conversation.
     * @param agentId The ID of the agent.
     * @return True if the operation was successful, false otherwise.
     */
    boolean removeExceptLatest(String conversationId, String agentId);

    /**
     * Remove messages by agent ID for a specific conversation.
     * @param conversationId The ID of the conversation.
     * @param agentId The ID of the agent.
     * @return True if the operation was successful, false otherwise.
     */
    boolean removeAgentId(String conversationId, String agentId);
}
